#include <iostream>

using namespace std;

int main(){
	int x;
	cin>>x;
	
	if(x%2==0 && (x>4&&x<=12)){
		cout<<1<<" ";
	}else{
		cout<<"0 ";
	}
	
	if(x%2==0 || (x>4&&x<=12)){
		cout<<1<<" ";
	}else{
		cout<<"0 ";
	}
	
	if(x%2==0){
		if(x>4&&x<=12){
			cout<<"0 ";
		}else{
			cout<<"1 ";
		}
	}else{
		if(x>4&&x<=12)
			cout<<"1 ";
		else
			cout<<"0 ";
	}
	
	if(x%2==0 || (x>4&&x<=12)){
			cout<<0<<" ";
	}else{
		cout<<"1 ";
	}
	return 0;
}
